from selenium import  webdriver
import time
from selenium.webdriver.common.by import By


driver = webdriver.Chrome(r'D:\bianchengerbianchenger\driver\chromedriver.exe')
driver.get('https://www.baidu.com')
driver.maximize_window()
time.sleep(2)

#基本定位    用by  定位id
driver.find_element(By.ID,'kw').send_keys('雪落无尘处')

driver.find_element(By.NAME,'kw').send_keys('无复顾清寒')

driver.find_element(By.CLASS_NAME,'s_ipt').send_keys('银鬓两相望')    #class值有空格 改成.

driver.find_element(By.LINK_TEXT,"新闻").click()      #全部匹配
driver.find_element(By.PARTIAL_LINK_TEXT,'新闻').click()      #部分匹配

all_input=driver.find_elements(By.TAG_NAME,'input')               #这里是elements
print(len(all_input))






time.sleep(2)
driver.quit()












